// 评分组件设置
export default {
  props: {
    value: [String, Number],
    options: Object
  },
  render(h) {
    var value = parseFloat(this.value || 0)
    var base = parseFloat(this.options && this.options.base)
    if (base > 0) {
      while (value > base) {
        value = value / base
      }
    }
    var _opt = Object.assign(
      {
        max: 5,
        disabled: true,
        showScore: true,
        allowHalf: true,
        textColor: '#ff9900',
        scoreTemplate: '{value}'
      },
      this.options,
      {
        value: value
      }
    )
    return h('el-rate', {
      props: _opt
    })
  }
}
